package com.cardone.platform.usercenter.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.usercenter.dto.DepartmentDto;

/**
 * 部门服务
 *
 * @author yaohaitao
 */
public interface DepartmentService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.usercenter.service.DepartmentService";

	/**
	 * 保存:部门
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveDepartment
	 *            部门对象
	 * 
	 * @return 部门对象
	 */
	@Deprecated
	@CacheEvict(value = DepartmentService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, DepartmentDto saveDepartment);

	/**
	 * 保存:部门
	 * 
	 * @param saveDepartment
	 *            部门对象
	 * 
	 * @return 部门对象
	 */
	@Deprecated
	@CacheEvict(value = DepartmentService.BEAN_ID, allEntries = true)
	DepartmentDto saveByIdOrCode(DepartmentDto saveDepartment);

	/**
	 * 插入
	 * 
	 * @param insertDepartment
	 *            部门对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DepartmentService.BEAN_ID, allEntries = true)
	int insertByCode(DepartmentDto insertDepartment);
	
	/**
	 * 删除
	 * 
	 * @param deleteDepartment
	 *            部门对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DepartmentService.BEAN_ID, allEntries = true)
	int deleteByIds(DepartmentDto deleteDepartment);

	/**
	 * 更新
	 * 
	 * @param updateDepartment
	 *            部门对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DepartmentService.BEAN_ID, allEntries = true)
	int updateByCode(DepartmentDto updateDepartment);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readDepartment
	 *            部门对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(DepartmentDto readDepartment);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDepartment
	 *            部门对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, DepartmentDto findDepartment);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDepartment
	 *            部门对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, DepartmentDto findDepartment);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListDepartment
	 *            部门对象
	 * 
	 * @return 部门对象集合
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, DepartmentDto findListDepartment);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 部门对象集合
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationDepartment
	 *            部门对象
	 * 
	 * @return 部门分页对象
	 */
	@Deprecated
	@Cacheable(value = DepartmentService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, DepartmentDto paginationDepartment);
}